{extend name='admin@main'}

{block name="content"}
<style type="text/css">
    .layui-col-xs4 {
    width: 15%;
}
</style>

{include file='store@goods/form_style'}

<form onsubmit="return false;" id="GoodsForm" data-auto="true" method="post" class='layui-form layui-card' autocomplete="off">
<div class="layui-card-body think-box-shadow padding-left-40">
  <div class="layui-form-item">
    <label class="layui-form-label">活动标题</label>
    <div class="layui-col-xs10" >
      <input name="name" lay-verify="name" value="{$vo.name|default=""}" style="width:500px;" autocomplete="off" placeholder="请输入标题" class="layui-input" type="text">
    </div>
  </div>
 
  <div class="layui-form-item">
    <label class="layui-form-label">活动图片</label>
      <label class="layui-col-xs4 think-form-group-left" style="width: 24%;">
          <input name="cover" style="width:385px;"  value='{$vo.cover|default=""}' placeholder="请上传分类图片" class="layui-input">
      </label>
      <a class="layui-btn think-form-group-left" data-file="btn" data-field="cover" data-type="png,jpg,gif">
          <i class="layui-icon layui-icon-upload"></i> 上传图片
      </a>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">兑换比例</label>
    <div class="layui-col-xs10" >
      <input name="publish_bean" type="number" lay-verify="publish_bean" value="{$vo.publish_bean|default="0"}" style="width:500px;" autocomplete="off" placeholder="请输入发布豆兑换比例" class="layui-input" type="text">
      <p class="color-desc">一元人民币几个发布豆 </p>
    </div>

  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">充值送发布豆</label>
    <div class="layui-col-xs10" >
      <input name="charge_bean" type="number"  lay-verify="charge_bean" value="{$vo.charge_bean|default="0"}" style="width:500px;" autocomplete="off" placeholder="" class="layui-input" type="text">
      <p class="color-desc">充值一元人民币 送 几个发布豆 </p>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">充值送积分</label>
    <div class="layui-col-xs10" >
      <input name="charge_credit" type="number"  lay-verify="charge_credit" value="{$vo.charge_credit|default="0"}" style="width:500px;" autocomplete="off" placeholder="" class="layui-input" type="text">
      <p class="color-desc">充值一元人民币 送 几个积分 </p>
    </div>
  </div>
  <div class="layui-form-item">
            <label class="layui-form-label">广告有效期</label>
            {notempty name='$vo.id'}

            <label class="layui-col-xs4">
                <input name="start_time" id="test1" placeholder="开始时间" value="{$vo.start_time|date='Y-m-d'}
"  autocomplete="off" class="layui-input" type="text">
            </label>
            <label class="layui-col-xs4" style="margin-left: 5px;">
                <input name="end_time" id="test2" placeholder="截止时间" value="{$vo.end_time|date='Y-m-d'}"  autocomplete="off" class="layui-input" type="text">
            </label>
            {else /}
                        <label class="layui-col-xs4">
                <input name="start_time" id="test1" placeholder="开始时间" value="{$vo.start_time|default=''}
"  autocomplete="off" class="layui-input" type="text">
            </label>
            <label class="layui-col-xs4" style="margin-left: 5px;">
                <input name="end_time" id="test2" placeholder="截止时间" value="{$vo.end_time|default=''}"  autocomplete="off" class="layui-input" type="text">
            </label>
            {/notempty}
        </div>
  <div class="layui-form-item ">
    <div class="layui-inline">
      <label class="layui-form-label">是否显示</label>
      <div class="layui-input-block">
        <input name="status" value="1" title="是" {eq name='vo.status|default="1"' value='1'} checked {/eq} type="radio">
        <input name="status" value="0" title="否" {eq name='vo.status|default="1"' value='0'} checked {/eq} type="radio">
      </div>
    </div>
  </div>

  <div class="layui-form-item ">
    <div class="layui-form-item block">
          <span class="label-required-prev color-green">活动详情</span>
          <textarea name="content">{$vo.content|default=''}</textarea>
    </div>
  </div>
    
  <div class="layui-form-item ">
    {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
      <button class="layui-btn" type="submit">保存</button>
  </div>
</div>
</form>
{/block}

{block name='script'}

<script>
 window.form.render();
    layui.use('laydate', function(){
        var laydate = layui.laydate;
        //常规用法
        laydate.render({
          elem: '#test1'
        });
        laydate.render({
          elem: '#test2'
        });
    });

  require(['ckeditor', 'angular'], function () {
     window.createEditor('[name="content"]', {height: 200});
   });
</script>

{/block}